home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
comm
/
irc
/
KuangEleven3Gm.lha
/
Kuang Eleven 3
/
Rexx
/
CTCP
/
VOTE.amirx
< prev
next >
Wrap
Text File
|
1998-05-09
|
1KB
|
49 lines
/* $VER: VOTE.amirx 3.0 (9.5.98) Voteman CTCP plugin
*/
options results
parse arg ':'prefix' 'type' 'channel' :'text
parse var prefix nick'!'user'@'host
div='01'x
parse var text (div) command option . (div)
if upper(command)~='VOTE' then exit
/* Usual startup lines */
/* Check if he voted twice */
hosts=getclip('st_vt_voters')
if find(hosts,host)~=0 then do
notice(nick,'You have voted already')
cecho(nick 'voted twice')
exit
end
/* Check if he voted correctly */
options=getclip('st_vt_opts')
if options='' then do
notice(nick,'There is no vote right now.')
cecho(nick 'tried to vote.')
exit
end
if ~datatype(option,'W') then signal badargs
if options<option|option<0 then signal badargs
/* Register vote */
count=getclip('st_vt_cnt'option)
if count='' then count=1
else count=count+1
call setclip('st_vt_cnt'option,count)
call setclip('st_vt_voters',getclip('st_vt_voters') host)
users=getclip('st_vt_users')
if find(users,nick)~=0 then call setclip('st_vt_users',delword(users,find(users,nick),1))
notice(nick,'Thank you for voting : 'option'.' getclip('st_vt_desc'option))
cecho(nick 'voted' option'.Total :'count'.')
exit
badargs:
notice(nick,option 'is not a valid vote.')
cecho(nick 'voted ilegale :' option '(' text')')
exit
bld:;bld = x2c('02');return bld||arg(1)||bld
notice:;'QueueRAW NOTICE' arg(1) ':'arg(2);return 0
cecho:;"ECHO P="d2c(27)"b«Vote»" arg(1);return 0